package com.gopay.common.gateway.dao.impl;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.pg.PgCbRmbOrderAssistDtl;
import com.gopay.common.gateway.dao.PgCbRmbOrderAssistDtlDAO;
import org.springframework.stereotype.Repository;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description: 跨境人民币进口分账辅助表DAO实现类
 * @Class: PgCbRmbOrderAssistDtlDAOImpl.java
 * @Author: b.zou
 * @Date: 2017-08-01 www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("pgCbRmbOrderAssistDtlDAO")
public class PgCbRmbOrderAssistDtlDAOImpl extends BaseDAOImpl<PgCbRmbOrderAssistDtl, Serializable> implements
        PgCbRmbOrderAssistDtlDAO {
    @Override
    public PgCbRmbOrderAssistDtl findPgCbrAssistDtl(Integer transDtlSq){
        String hql = " from PgCbRmbOrderAssistDtl t where t.transDtlSq = :transDtlSq order by t.transDtlSq asc ";
        Map<String,Object> param = new HashMap<>();
        param.put("transDtlSq", transDtlSq);
        List<PgCbRmbOrderAssistDtl> list = findByHql(hql, param);
        if(list.size()>0){
            return list.get(0);
        }else{
            return null;
        }
    }
}
